package com.ineatconseil.yougo.client.ui.main.application.header;

import com.google.gwt.core.client.GWT;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiHandler;
import com.google.gwt.uibinder.client.UiTemplate;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.HTMLPanel;

/**
 * @author Benjamin Barbier - Ineat Conseil
 */
public class HeaderViewImpl extends Composite implements IHeaderView {

	@UiTemplate("HeaderUiBinder.ui.xml")
	interface HeaderUiBinder extends UiBinder<HTMLPanel, HeaderViewImpl> {}

	private static HeaderUiBinder uiBinder = GWT.create(HeaderUiBinder.class);

	public HeaderViewImpl() {
		System.out.println("HeaderViewImpl - constructor");
		initWidget(uiBinder.createAndBindUi(this));
	}

	@UiHandler("disconnectLink")
	void onDisconnectLinkClick(ClickEvent event) {
		//TODO: implement !
		Window.alert("Disconnect !");
//		goTo(new LoginPlace("LoginPlace"));
	}
	
	@UiHandler("changePasswordLink")
	void onChangePasswordLinkClick(ClickEvent event) {
		//TODO: implement !
		Window.alert("Change Password !");
	}
	
}
